package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.AsyType;
import com.zcx.helper.http.note.HttpCache;
import com.zcx.helper.http.note.HttpInlet;
import com.zcx.helper.http.note.HttpNew;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/6/1.
 */
@HttpInlet(Conn.INLET_API_MINE_PERSONALCENTER)
public class GetApiPersonalCenter extends BaseAsyGet<GetApiPersonalCenter.Info> {
    public String userid;

    public GetApiPersonalCenter(AsyCallBack<GetApiPersonalCenter.Info> asyCallBack) {
        super(asyCallBack);
    }

    protected Info parser(JSONObject jsonObject) {

        TOAST = jsonObject.optString("message");
        if (jsonObject.optInt("code") == 200) {

            Info info = new Info();
            JSONObject o = jsonObject.optJSONObject("data");

            Data d = new Data();
            d.id = o.optString("id");
            d.headurl = Conn.IMGURL + o.optString("headurl");
            d.username = o.optString("username");
            d.level = o.optString("level");

            info.data = d;

            return info;
        }
        return null;
    }


    public static class Info {
        public Data data;
    }

    public static class Data {

//        "id": "1",
//                "headurl": "",
//                "username": "13101618368",
//                "level": "会员"

        public String id;
        public String headurl;
        public String username;
        public String level;
    }
}
